Create and link against libllvmlibc-sparse#40
Merged
Merged
Conversation
Using musl solved our static linking woes, but introduced performance regressions. Specifically, calls to memset, memcpy, memcmp, and strlen became more noticeable in profiles. Build llvmlibc, extract the .o files from the .a for those 4, repack them in a new .a, then link against that. llvmlibc's strlen isn't measurably better, but the author is aware and interested in fixing. Fixes #39
compnerd
approved these changes
Jul 14, 2022
compnerd
left a comment
Member
There was a problem hiding this comment.
This feels like tihi worthy.
| -C llvm-project/stage3.cmake \ | ||
| -D LLVM_DEFAULT_TARGET_TRIPLE=$(clang -print-target-triple) \ | ||
| -S llvm-project/llvm \ | ||
| -D CMAKE_EXE_LINKER_FLAGS="-static -lc++abi -ljemalloc -lllvmlibc-sparse -Wl,--allow-multiple-definition" \ |
Member
There was a problem hiding this comment.
I tend to prefer -Xlinker --allow-multiple-definition. However, this is gross either way.
nathanchance
approved these changes
Jul 14, 2022
nathanchance
left a comment
Member
There was a problem hiding this comment.
LGTM with some minor nits.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Using musl solved our static linking woes, but introduced performance
regressions. Specifically, calls to memset, memcpy, memcmp, and strlen
became more noticeable in profiles.
Build llvmlibc, extract the .o files from the .a for those 4, repack
them in a new .a, then link against that.
llvmlibc's strlen isn't measurably better, but the author is aware and
interested in fixing.
See
#39 (comment)
for performance measurements.
Fixes #39